# http://cbor.io/
import json

import flynn
import cbor
print("test flynn")
pyobj = [1, [2, 3]]
dumpobj  = flynn.dumps(pyobj)
print(f"flynn dump: {dumpobj}")
print(f"flynn loads: {flynn.loads(dumpobj)} ")

print(f"cbar.dumps: {cbor.dumps(pyobj)}");
print(f"cbar.loads: {cbor.loads(dumpobj)}");

jobj = dict()
jobj["name"]="tester"
jobj["values"]=["a","b","c"]
jobj["balance"] = 100
jsonstr = json.dumps(jobj,indent=4)

print("jsonstr",jsonstr)
cbordata = cbor.dumps(jobj)
print("cbordata",cbordata)
jsonobjnew = flynn.loads(cbordata)
print("cbor json ",jsonobjnew)
